import 'package:basic_ui/common_widgets/my_small_widget.dart';
import 'package:basic_ui/constants/app_sizes.dart';
import 'package:basic_ui/localization/string_hardcoded.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class AboutUsScreen extends StatelessWidget {
  const AboutUsScreen({super.key});

  @override
  Widget build(BuildContext context) {
    const hasUpdate = true;
    return Scaffold(
      appBar: AppBar(
        title: const Text('关于我们'),
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(Sizes.p16),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Center(
              child: Column(
                children: [
                  SvgPicture.asset(
                    'assets/images/insail-logo.svg',
                    width: 100,
                    height: 100,
                    semanticsLabel: 'InSail Flutter Boot'.hardcoded,
                  ),
                  gapH24,
                  Text(
                    'InSail Flutter Boot Template'.hardcoded,
                    style: const TextStyle(
                      fontSize: 16,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                  gapH8,
                  Text(
                    'V5.3.80 (0799) RLC'.hardcoded,
                    style: const TextStyle(
                      fontSize: 12,
                      color: Colors.grey,
                    ),
                  ),
                ],
              ),
            ),
            gapH24,
            ListTile(
              title: const Text.rich(
                TextSpan(
                  text: '软件更新', // Black color for "软件更新"
                  children: <TextSpan>[
                    TextSpan(
                      text:
                          '（有新版可以更新）', // Red color for the part inside parentheses
                      style: TextStyle(
                        color: hasUpdate
                            ? Colors.redAccent
                            : Colors
                                .black, // Red if update is available, else black
                      ),
                    ),
                  ],
                ),
              ),
              trailing: MySmallWidgets.listTileTrailingIcon(),
              onTap: () {
                // 处理访问官网的逻辑
              },
            ),
            ListTile(
              title: Text(
                '协议与政策'.hardcoded,
              ),
              trailing: MySmallWidgets.listTileTrailingIcon(),
              onTap: () {
                // 处理访问官网的逻辑
              },
            ),
            ListTile(
              title: Text('访问官网'.hardcoded),
              trailing: MySmallWidgets.listTileTrailingIcon(),
              onTap: () {
                // 处理访问官网的逻辑
              },
            ),
            ListTile(
              title: Text('加入我们'.hardcoded),
              trailing: MySmallWidgets.listTileTrailingIcon(),
              onTap: () {
                // 处理加入我们的逻辑
              },
            ),
            gapH24,
            Center(
              child: Column(
                children: [
                  Text(
                    '《个人信息收集清单》 | 《第三方信息共享清单》'.hardcoded,
                    style: const TextStyle(
                      fontSize: 10,
                      color: Colors.grey,
                    ),
                  ),
                  gapH8,
                  Text(
                    'MailMemo Inc Copyright 2025'.hardcoded,
                    style: const TextStyle(
                      fontSize: 10,
                      color: Colors.grey,
                    ),
                  ),
                  Text(
                    '粤ICP备18119697号-7A'.hardcoded,
                    style: const TextStyle(
                      fontSize: 10,
                      color: Colors.grey,
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
